package com.t309.tzy.mapper;
import com.t309.tzy.entity.TSysUser;
import com.t309.tzy.utils.PageSupport;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * 入库记录表相关接口
 */
public interface TSysUserMapper {

    int login(@Param("account") String account, @Param("password") String password);

    List<TSysUser> findAllUsers();

    /**
     * 分页查询
     * @param currentNo
     * @param pageSize
     * @return
     */
    List<TSysUser> findAllUsersByPage(@Param("currentNo")int currentNo,@Param("pageSize")int pageSize);

    TSysUser findUserInfoById(int id);

    int findUserIdByAccount(String account);

    /**
     * 查询总数
     * @param roleId
     * @return 总数
     *///@Param("userName")String userName,
    Integer findUserCount(@Param("realName")String realName, @Param("roleId") Integer roleId);

    //查询
    List<TSysUser> findUserListPagingByRealNameAndRoleId(@Param("realName")String realName,
                                                         @Param("roleId")Integer roleId,
                                                         @Param("pageSupport") PageSupport pageSupport);

    List<TSysUser> findUserListByRoleId(int roleId);

    List<TSysUser> findUserListByRoleIdArray(Integer[] roleIds);

    List<TSysUser> findUserListByRoleIdList(List<Integer> roleList);

    public int insert(TSysUser user);

    public int insertMultiple(List<TSysUser> userList);

    public int update(TSysUser user);

    boolean updateUserPassword(@Param("id")int id,@Param("newPassword")String newPassword);

    public int delete(int id);

    public List<TSysUser> selectLimitTSysUser();

}
